<!DOCTYPE HTML>
<html lang="zh">
<head>
    {include file="public/meta"}
    <title>用户列表</title>

</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>首页 <span class="c-gray en">&gt;</span>权限管理 <span class="c-gray en">&gt;</span>用户列表<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <div class="text-c">
        <form action="{:url()}" method="get">
            <select name="role_id" id="role_id" class="input-text" style="width: 100px;">
                <option value="">用户组</option>
                {foreach $auth_role as $item}
                <option {:isset($param.role_id) && $param.role_id==$item.id?'selected':''} value="{$item.id}">{$item.name}</option>
                {/foreach}
            </select>
            <input type="text" value="{$param.keyword??''}"  class="input-text" style="width:250px" placeholder="输入关键字搜索"  name="keyword">
            <button type="submit" class="btn btn-success radius"  name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </form>

    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">
        <a href="javascript:;" title="新增" onclick="openPage('添加','{:url(\'form\')}','800','600')" class="btn btn-primary radius">
            <i class="Hui-iconfont">&#xe600;</i></a></span> <span class="r">共有数据：<strong>{$data?$data->total():'0'}</strong> 条</span> </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-hover table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th width="80">ID</th>
                <th width="100">用户名</th>
                <th width="100">用户组</th>
                <th width="100">昵称</th>
                <th width="100">通知邮箱</th>
                <th width="100">数量</th>
                <th width="100">域名</th>
                <th width="100">日志</th>
                <th width="160">更新时间</th>
                <th width="70">状态</th>
                <th width="130">操作</th>
            </tr>
            </thead>
            <tbody>
            {if !empty($data)}
            {foreach $data as $item}
            <tr class="text-c">
                <td>{$item.id}</td>
                <td onclick="copy(this)">{$item.username|default=''}</td>
                <td>{:getArrayName($item['role_id'],$auth_role)}</td>
                <td onclick="copy(this)">{$item.nickname|default=''}</td>
                <td onclick="copy(this)">{$item.email|default=''}</td>
                <td onclick="copy(this)">{$item.number|default=''}</td>
                    
                <td><a title="域名" href="{:url('domain/index',['admin_id'=>$item.id])}"  class="ml-5">查看</a></td>
                <td><a title="域名" href="{:url('log/email',['admin_id'=>$item.id])}"  class="ml-5">查看</a></td>
                <td>{$item.updatetime|default=''}</td>
                <td>
                    <span class="label {$item.status==1?'label-success':'label-danger'} radius">{$item.status==1?'启用中':'已禁用'}</span>
                </td>
                <td class="td-manage">
                    <a style="text-decoration:none" onClick="setStatus('{$item.status}','{$item.id}')" href="javascript:void(0) ;" title="{$item.status==1?'停用':'启用'}">
                        <i class="Hui-iconfont">{$item.status==1?'&#xe631;':'&#xe615;'}</i>
                    </a>

                    <a title="编辑" href="javascript:;" onclick="openPage('添加','{:url(\'form\',[\'id\'=>$item.id])}','800','600')"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
                    <a title="删除"  href="javascript:;" onclick="del('{$item.id}')"  class="ml-5 c-red" style="text-decoration:none"><i class="Hui-iconfont Hui-iconfont-del"></i></a>

                </td>
            </tr>
            {/foreach}

            {/if}


            </tbody>

        </table>

        <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
            {$data?$data->render()|raw:''}
        </div>
    </div>
</div>

{include file="public/footer"}
<script type="text/javascript" src="/static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="/static/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/lib/laypage/1.2/laypage.js"></script>
<script>
    function setStatus(status,id) {
        layer.confirm('确定'+(status==1?'禁用':'启用')+'吗？',{title:null},function () {
            sendData("{:url('action_data')}",{type:'setStatus',id:id,status:status==1?0:1},function (res) {
                if (res.code==0){
                    location.reload()
                }
            })
        })
    }
    function del(id) {
        layer.confirm('确定删除吗？',{title:null},function () {
            sendData("{:url('action_data')}",{type:'del',id:id},function (res) {
                if (res.code==0){
                    location.reload()
                }
            })
        })
    }
</script>
</body>
</html>